#include "networkinfo.h"
#include "remotedef.h"
#include <QVariant>

NetworkInfo::NetworkInfo()
{
    ifname="";
    ip ="";
    mask = "";
    gateway = "";
    mac = "";
    active = false;
}

void NetworkInfo::unserialize(QString json)
{
    BaseResp::unserialize(json);
    if (m_json.isValid())
    {
        ifname = m_json.value(KEY_NETWORK_IFNAME).toString();
        ip = m_json.value(KEY_NETWORK_IP).toString();
        mask = m_json.value(KEY_NETWORK_MASK).toString();
        gateway = m_json.value(KEY_NETWORK_GATEWAY).toString();
        mac = m_json.value(KEY_NETWORK_MAC).toString();
        dns = m_json.value(KEY_NETWORK_DNS).toString();
        active = m_json.value(KEY_NETWORK_ACTIVE).toString() == "true"?true:false;
    }
}

QString NetworkInfo::getIfname() const
{
    return ifname;
}

void NetworkInfo::setIfname(const QString &value)
{
    ifname = value;
}
QString NetworkInfo::getIp() const
{
    return ip;
}

void NetworkInfo::setIp(const QString &value)
{
    ip = value;
}
QString NetworkInfo::getMask() const
{
    return mask;
}

void NetworkInfo::setMask(const QString &value)
{
    mask = value;
}
QString NetworkInfo::getGateway() const
{
    return gateway;
}

void NetworkInfo::setGateway(const QString &value)
{
    gateway = value;
}
QString NetworkInfo::getMac() const
{
    return mac;
}

void NetworkInfo::setMac(const QString &value)
{
    mac = value;
}
bool NetworkInfo::getActive() const
{
    return active;
}

void NetworkInfo::setActive(bool value)
{
    active = value;
}
QString NetworkInfo::getDns() const
{
    return dns;
}

void NetworkInfo::setDns(const QString &value)
{
    dns = value;
}







